'''
from functools import partial

money = 10000

def func(m, mode="in"):
    global money
    if mode == "in":
        money = money + m
    elif mode == "out":
        money = money - m

newfunc = partial(func,5000 - 5000 * 5/10000)
newfunc()
print(money)
'''
'''
a = [1,2,3,4]
b = ["a","b","c","d"]
print(list(zip(a,b)))
print(dict(zip(a,b)))
'''

# 生成器
# 使用算法来推导下一个值
'''
def myrange(n):
    for i in range(n):
        yield i

for i in myrange(10):
    print(i)
'''

# 生成器处理大数据读取

def read_file():
    with open("dictionary.txt", "r") as f:
        for i in f:
            yield i

for i in read_file():
    print(i)

